prepare("select * from invent_details where invent_id = '$id'") ; $getd->execute() ; //get tsum $gsum = $DBcon->prepare("select sum(total_cost) as tcost from invent_details where invent_id = '$id'") ; $gsum->execute() ; $grow = $gsum->fetch(pdo::FETCH_ASSOC) ; $tsum = $grow['tcost'] ; if(isset($_POST['search'])) { //$date1 = trim($_POST['date1']) ; //$date2 = trim($_POST['date2']) ; } ?>